unit UnitColor;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TFormColor = class(TForm)
    LabelColor: TLabel;
    LabelColor2: TLabel;
    btnKreuz: TButton;
    btnPik: TButton;
    btnHerz: TButton;
    btnKaro: TButton;
    procedure FormCreate(Sender: TObject);
    procedure btnKreuzClick(Sender: TObject);
    procedure btnPikClick(Sender: TObject);
    procedure btnHerzClick(Sender: TObject);
    procedure btnKaroClick(Sender: TObject);
    function getColor: Integer;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
        ChoseColor: boolean;
        Color: Integer;


implementation

{$R *.DFM}

procedure TFormColor.FormCreate(Sender: TObject);
begin
        ChoseColor := False;
end;

procedure TFormColor.btnKreuzClick(Sender: TObject);
begin
        Color := 1;
        ChoseColor := True;
        self.ModalResult := mrOk;
end;



procedure TFormColor.btnPikClick(Sender: TObject);
begin
        Color := 2;
        ChoseColor := True;
        self.ModalResult := mrOk;
end;

procedure TFormColor.btnHerzClick(Sender: TObject);
begin
        Color := 3;
        ChoseColor := True;
        self.ModalResult := mrOk;
end;

procedure TFormColor.btnKaroClick(Sender: TObject);
begin
        Color := 4;
        ChoseColor := True;
        self.ModalResult := mrOk;
end;

function TFormColor.getColor: integer;
begin
        result := color;
end;

end.
